<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>footer</title>
</head>
<body>
    <div th:fragment="copy1">
        &copy; 2021
    </div>
    <footer th:fragment="copy2" >
        &copy; 2020-2023
    </footer>
    <div id="copy-section">
        <p>没有使用th:fragment属性的片段可以通过id属性来引用</p>
    </div>
    <div th:fragment="frag (var1,var2)">
        <p th:text="${var1} + ' - ' + ${var2}">th:fragment定义的⽚段可以指定⼀组参数</p>
    </div>
    <div th:fragment="frag2">
        <p th:text="${var1} + ' * ' + ${var2}">没有定义参数的模板片段</p>
    </div>
    <div th:fragment="assert-test (user)" th:assert="${user.id != null},${!#strings.isEmpty(user.username)},${!#strings.isEmpty(user.password)}">
        <p th:text="${#strings.toString(user)}">⽤th:assert进⾏模版内部断⾔ </p>
    </div>
</body>
</html>